const { openJson } = require("../utils/fileSystem");

const dynamicVariables = ['SAVE_LOG'];

const envService = {
    get: (name) => process.env[name],

    set: (name, value) => { process.env[name] = value },

    update: () => {
        const settings = openJson(__dirname, '..', 'config', 'settings.json');

        for(let name of dynamicVariables) process.env[name] = settings[name];
    }
};

module.exports = envService;
